﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Prism.Events;

namespace Infrastructure
{
    public abstract class ModuleBase : IModule
    {
        #region Properties

        public IUnityContainer Container { get; set; }
        public IRegionManager RegionManager { get; set; }
        public IEventAggregator EventAggregator { get; set; }

        #endregion

        #region Constructors

        public ModuleBase(IEventAggregator eventAggregator, IUnityContainer container, IRegionManager regionManager)
        {
            this.EventAggregator = eventAggregator;
            this.Container = container;
            this.RegionManager = regionManager;
        }

        #endregion

        #region Implementation of IModule

        public virtual void Initialize()
        {
            RegisterViewsAndServices();
        }

        protected abstract void RegisterViewsAndServices();

        #endregion
    }
}
